package org.tinygroup.trans.template.springtrans;

import org.springframework.messaging.Message;
import org.tinygroup.trans.template.util.TemplateConvertUtil;

public class TemplateTransformDefault {
	private static final String TEMPLATE_SCENE = "BIZ_SCENE";

	/**
	 * 对象转xml，采用template的方式
	 * 
	 * @param inMessage
	 * @return
	 */
	public String transfor2Str(Message<?> inMessage) {
		String scene = (String) inMessage.getHeaders().get(TEMPLATE_SCENE);
		return TemplateConvertUtil.convert(inMessage.getPayload(), scene);
	}

}
